﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="BaseData_ServiceStationDetail" Codebehind="ServiceStationDetail.aspx.cs" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <script type="text/javascript" src="../Include/JS/Address.js"></script>
    <script type="text/javascript" src="../Include/JS/Lib/jquery-1.1.4.js"></script>
    <script type="text/javascript" src="../Include/Js/OpenWindow.js"></script>
    <script type="text/javascript">
         var  $j = jQuery.noConflict();
        function GetAreaListAndCountTotal(value,selectvalue)
        {   
            LoadArea=false;
            if(parseInt(value)>-1)
            {
                $j.post("../Handler/AddressHandler.ashx", {City:value, OP:"Area"},
                        function(data){                          
                           InitArea(data,selectvalue);
                        }
                    );
             }
             else
             {
                var sel = document.getElementById("Area"); 
            
                while( sel.length>0 )
                {
                    sel.removeChild(sel.options(0));
                    
                }
                sel.options[0]=new Option("请选择","-1");
             }
             var hidCity = document.getElementById("hidCity");
             hidCity.value=value;
             if(value!="-1")
             {
                document.getElementById("hidCityCode").value = value;
             }
             else
             {
                document.getElementById("hidCityCode").value = "000001";
             }
             
             
        }
        function SetAreaCode()
        {
            var dropArea = document.getElementById("Area");
            if(dropArea.options[0].selected)
            {
                document.getElementById("hidAreaCode").value = "000001";
                return;
            }
            for(var i=0;i<dropArea.options.length;i++)
            {
                if(dropArea.options[i].selected)
                {
                    document.getElementById("hidAreaCode").value = dropArea.options[i].value;
                    break;
                }
            }
        }
        
        function InitAddress()
        {
            var hidReceiveAddressInfo = document.getElementById("hidReceiveAddressInfo");
            var addressInfo = hidReceiveAddressInfo.value.split('$');
            var dropProvince = document.getElementById("Province");
            var dropCity = document.getElementById("City");
            var dropArea = document.getElementById("Area");
                        
            for(var i=0;i<dropProvince.options.length;i++)
            {
                if(dropProvince.options[i].value==addressInfo[0])
                {
                    dropProvince.options[i].selected = true;
                    break;
                }
            }
            
            GetCityList(addressInfo[0],addressInfo[1]);
            GetAreaList(addressInfo[1],addressInfo[2]); 
            document.getElementById("hidCityCode").value = addressInfo[1];
            document.getElementById("hidAreaCode").value = addressInfo[2];  
        }
    </script>
</head>
<body onload="InitAddress()">
    <form id="form1" runat="server">
    <div align="Justify">
      <h2>编辑服务站</h2>
        <div class="menu_bg">
        <asp:Button ID="btnSave" runat="server" CssClass="input_button" Text="保存" OnClick="btnSave_Click" />
        <asp:Button ID="btnCancel" runat="server" CssClass="input_button" Text="取消" OnClick="btnCancel_Click" /></div>
        <div class="menu_bg3"><input id="hidCityCode" runat="server" type="hidden" />
            <input id="hidAreaCode" runat="server" type="hidden" />
            <input id="hidCity" type="hidden" runat="server" />
            <input id="hidReceiveAddressInfo" type="hidden" runat="server" /><br />
        服务站编号：<asp:Label ID="lblServiceId" runat="server"></asp:Label>    
        <br />
        服务站名称：<asp:TextBox ID="txtServiceStationName" runat="server"></asp:TextBox><br />
        &nbsp;&nbsp;联系电话1：<asp:TextBox ID="txtPhone1" runat="server"></asp:TextBox><br />
        &nbsp;&nbsp;联系电话2：<asp:TextBox ID="txtPhone2" runat="server"></asp:TextBox><br />
        　　　地区：<select id="Province" runat="server" onchange="GetCityList(this.value)"></select>省
            <select id="City" runat="server" onchange="GetAreaListAndCountTotal(this.value)"></select>市
            <select id="Area" runat="server" onchange="SetAreaCode()"></select>区
        <br />
        　详细地址：<asp:TextBox ID="txtAddress" runat="server" Width="588px"></asp:TextBox><br />
        　管理帐号：<asp:DropDownList ID="dropAdmin" runat="server">
        </asp:DropDownList><br />
        　　　停用：<asp:RadioButton ID="rdoYes" runat="server" Text="是" GroupName="IsDel"/>
        <asp:RadioButton ID="rdoNo" runat="server" Text="否" GroupName="IsDel" />
        </div>
     </div>
    </form>
</body>
</html>
